package com.example.mapper;

import com.example.entity.Admin;
import com.example.entity.Dormitory;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Component;

import java.util.List;
@Component
public interface AdminMapper {
@Select("select * from admin")
    List<Admin> findAll();
@Select("select * from admin where admin_num = #{admin_num}")
List<Admin> findByid(String admin_num);


    int update(Admin admin);

    int insert(Admin admin);
    int insert1(Admin admin);
@Delete("delete from admin where admin_num=#{admin_num}")
    Integer deleteBy(Integer admin_num);

    List<Admin> selectPage(@Param("pageNum") Integer pageNum, @Param("pageSize") Integer pageSize, @Param("name") String name);

    Integer selectTotal(@Param("name") String name );
    @Select("SELECT * FROM admin WHERE admin_num = #{username}")
    Admin getAdminByUsername(String username);

    void updatepassword(Admin admin);
}
